package com.jdbc;

public class User {
    private int id;
    private String username;
    private String password;
    private int score;
    private String cellphone;
    private String manager;

    public User() {
    }

    public User(String cellphone, int id, String manager, String password, int score, String username) {
        this.cellphone = cellphone;
        this.id = id;
        this.manager = manager;
        this.password = password;
        this.score = score;
        this.username = username;
    }

    public String getCellphone() {
        return cellphone;
    }

    public void setCellphone(String cellphone) {
        this.cellphone = cellphone;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getManager() {
        return manager;
    }

    public void setManager(String manager) {
        this.manager = manager;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    public String toString() {
        return "User{" +
                "cellphone='" + cellphone + '\'' +
                ", id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", score=" + score +
                ", manager='" + manager + '\'' +
                '}';
    }

    // 修改 isAdmin 方法
    public boolean isAdmin() {
        return "yes".equalsIgnoreCase(manager);
    }

    // 添加 updateScore 方法
    public void updateScore(int score) {
        this.score += score;
    }
}